<!DOCTYPE html>
<html> 
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <#if group.status == 0>
    <meta http-equiv="refresh" content="2">
    </#if>
<title>yukari world</title>
    <#include "/lib/base_source.ftl">
      <style type="text/css">
      </style>
  </head> 
  <body>
    <div class='whole-container'>
      <#include "/lib/header.ftl">
        <div>
          <ul class="breadcrumb">
            <li>投票管理</li><span class="divider">/</span>
            <li>投票详情</li>
          </ul>
        </div>
        <div class="container-fluid">
          <div class="row-fluid">
            <div class="container span12">
              <#include "/lib/alert.ftl">
                 <div class='main-content'>
                    <div class="well form-horizontal">
                    	<form method="post" action="${rc.contextPath}/admin/vote/stopVote" id="stopVote"></form>
                        <div class='main-action'>
                    		<div class="control-group">
                                <label class="control-label">标题</label>
                                <div class="controls">
                                	${group.name}
                                </div>
                            </div>
                    		<div class="control-group">
                                <label class="control-label">投票开始时间</label>
                                <div class="controls">
                                	${group.startTime?string("yyyy-MM-dd HH:mm:ss")}
                                </div>
                            </div>
                    		<div class="control-group">
                                <label class="control-label">投票结束时间</label>
                                <div class="controls">
                                	<#if group.endTime??>
                                	${group.endTime?string("yyyy-MM-dd HH:mm:ss")}
                                	</#if>
                                </div>
                            </div>
                    		<div class="control-group" id="operate">
                                <label class="control-label">投票状态</label>
                                <div class="controls">
		                            <#if group.status == 0>
                                    <span style="color:green;">正在投票</span>
                                    <#else>
                                    <span style="color:red;">投票结束</span>
                                    </#if>
                                </div>
                            </div>
                    		<div class="control-group" id="operate">
                                <label class="control-label"></label>
                                <div class="controls">
	                            <#if group.status == 0>
                                    <a href="javascript:$('#stopVote').submit()" class="btn btn-info btn-sm">停止投票</a>
	                            <#else>
                                    <a href="${rc.contextPath}/admin/vote/index" class="btn btn-info btn-sm">返回</a>
	                            </#if>
                                </div>
                            </div>
                        </div>
                    </div> 
                    
                    <div class="table-content">
                    <#-- table -->
                        <table class="table-striped table-condensed table-hover" id="itemTable" style="width: 100%;max-width: 100%;margin-bottom: 20px;font-size:12px;word-break:break-all;word-wrap:break-word;">
                        	<#if group.items??>
                        	<thead>
                        	<tr>
                        		<th>投票项</th>
                        		<th>备注</th>
                        		<th>人数</th>
                        		<th></th>
                        	</tr>
                        	</thead>
                        	 <tbody>
                            <#list group.items as item>
                            	<tr>
                                	<td>${item.key}</td>
                                	<td>${item.note!}</td>
                                	<td><#if group.total=0>0<#else>${item.count*100/group.total}%</#if></td>
                                	<td>
                                	</td>
                                </tr>
                            </#list>
                             </tbody>
                            </#if>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
  <script>
    $(document).ready(function() {
    	
	});
	
	function getDetail(id){
		location.href = "${rc.contextPath}/admin/vote/getVoteItemDetail?itemId="+id;
	}
	
		
   </script>
</body>
</html>